home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / pdcurs21 / portable / touchlin.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-18  |  1.4 KB  |  60 lines

  1. #define    CURSES_LIBRARY    1
  2. #include <curses.h>
  3. #undef    touchline
  4.  
  5. #ifdef PDCDEBUG
  6. char *rcsid_touchlin = "$Header: C:\CURSES\portable\RCS\touchlin.c 2.1 1993/06/18 20:21:19 MH Rel MH $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12.  
  13. /*man-start*********************************************************************
  14.  
  15.   touchline()    - touch line in window
  16.  
  17.   PDCurses Description:
  18.      Similar to touchwin(), but less drastic.
  19.  
  20.      Throw away all optimisation information about which parts of the
  21.      window (well, lines) have been touched, by pretending that the
  22.      entire line(s) has been drawn on.
  23.  
  24.   PDCurses Errors:
  25.      The touchline() function returns OK on success and ERR on error.
  26.  
  27.      It is an error to pass a NULL window.
  28.  
  29.      It is also an error to specify a line outside the boundaries of
  30.      the passed window or if the start line plus the number of lines
  31.      exceeds the boundary of the window.
  32.  
  33.   Portability:
  34.      PDCurses    
  35.      SysV Curses    
  36.      BSD Curses    
  37.  
  38. **man-end**********************************************************************/
  39.  
  40. int    touchline(WINDOW *w, int start,int num)
  41. {
  42.     register int i;
  43.  
  44. #ifdef PDCDEBUG
  45.     if (trace_on) PDC_debug("touchline() - called: start %d num %d\n",start,num);
  46. #endif
  47.  
  48.     if (w == (WINDOW *)NULL)
  49.         return( ERR );
  50.  
  51.     if  (start > w->_maxy || start + num > w->_maxy)
  52.         return( ERR );
  53.     for(i=start;i<start+num;i++)
  54.        {
  55.         w->_firstch[i] = 0;
  56.         w->_lastch[i] = w->_maxx - 1;
  57.        }
  58.     return( OK );
  59. }
  60.